package c.e.a.c.y.a;

import android.content.Context;
import android.content.res.TypedArray;
import android.util.AttributeSet;
import b.b.g.c;

/* compiled from: MaterialThemeOverlay */
public class a {
    public static final int[] a = new int[]{16842752, 2130969408};
    public static final int[] b = new int[]{2130969157};

    public static Context a(Context context, AttributeSet attributeSet, int i, int i2) {
        TypedArray obtainStyledAttributes = context.obtainStyledAttributes(attributeSet, b, i, i2);
        int resourceId = obtainStyledAttributes.getResourceId(0, 0);
        obtainStyledAttributes.recycle();
        Object obj = ((context instanceof c) && ((c) context).a == resourceId) ? 1 : null;
        if (resourceId == 0 || obj != null) {
            return context;
        }
        c cVar = new c(context, resourceId);
        TypedArray obtainStyledAttributes2 = context.obtainStyledAttributes(attributeSet, a);
        int resourceId2 = obtainStyledAttributes2.getResourceId(0, 0);
        i2 = obtainStyledAttributes2.getResourceId(1, 0);
        obtainStyledAttributes2.recycle();
        if (resourceId2 == 0) {
            resourceId2 = i2;
        }
        if (resourceId2 != 0) {
            cVar.getTheme().applyStyle(resourceId2, true);
        }
        return cVar;
    }
}
